#include<bits/stdc++.h>
#define y1 Y1
#define fi first
#define endl "\n"
#define se second
#define PI acos(-1)
#define int long long
#define pb(x) push_back(x)
#define PII pair<int, int>
#define Yes cout << "Yes\n";
#define No cout << "No\n";
#define YES cout << "YES\n";
#define NO cout << "NO\n";
#define _for(i, a, b) for(int i = a; i <= b; ++i)
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
using namespace std;

const int N = 2e5 + 10;
const int mod = 1e9 + 7;

int a[N];
int n, m, t, ret, k, x, ma;
string s;

bool check(int end) {
	int p = 0;
	for(int i = 1; i <= n; ++ i ) {
		if(a[i] > end) {
			p += (a[i] - end + x - 1) / x;
			if(p > k) {
				return false;
			}
		}
	//	cout << "i = " << i << " p = " << p << endl;
	}
	return p <= k;
}


signed main() {
	IOS;
	cin >> n >> k >> x;
	_for(i, 1, n) {
		cin >> a[i];
		ma = max(ma, a[i]);
	}
	
	int l = -1e18, r = ma + 1;
//	cout << check(3) << endl;
//	cout << check(2) << endl;
	while(l + 1 < r) {
		int mid = (l + r) >> 1;
		if(check(mid))r = mid;
		else l = mid;
	}
	cout << r << endl;
	return 0;
}


